
	<?php	
	
	// Redirect to https login if forced to use SSL
	if ( force_ssl_admin() && !is_ssl() ) {
		if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
			wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
			exit();
		} else {
			wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
			exit();
		}
	}
	function login_header($title = 'Log In', $message = '', $wp_error = '') {
		global $error, $is_iphone;
		
		if ( empty($wp_error) )
			$wp_error = new WP_Error();
	
		if ( $wp_error->get_error_code() ) {
			$errors = '';
			$messages = '';
			foreach ( $wp_error->get_error_codes() as $code ) {
				$severity = $wp_error->get_error_data($code);
				foreach ( $wp_error->get_error_messages($code) as $error ) {
	
					$error=str_replace(sprintf(__('<a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login')),"",$error);

					if ( 'message' == $severity )
						$messages .= '	' . $error . "<br />\n";
					else
						$errors .= '	' . $error . "<br />\n";
				}
			}
			if ( !empty($errors) )
				echo '<div class="err">' . apply_filters('login_errors', $errors) . "</div>\n";
			if ( !empty($messages) )
				echo '<p >' . apply_filters('login_messages', $messages) . "</p>\n";
			}
		} // End of login_header()

		if($_SESSION['error_login_role']=="")
		{
			$user = wp_signon('', $secure_cookie);
			$errors = $user;
			// Clear errors if loggedout is set.
			if ( $error_login!="" )
				$errors = new WP_Error();
				login_header(__('Log In'), '', $errors);
		}		
?>     
<div class="login">
    <p><font class="login-title">Login</font></p>
    <form method="POST" action="<?php bloginfo('url'); ?>/?action=sigin&amp;sigin=defaut">
    <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
	<input type="hidden" name="testcookie" value="1" />
    <p>Username:</p>
    <input type="text"  name="log" id="user_login"  size="15" class="input" value="<?php echo esc_attr($user_login); ?>" /><br />
    <p>Password:</p>
    <input type="password" name="pwd" id="user_pass" class="input" size="15"/><br />
    <div align="center">
    <a href="#">Forgot your password ?</a><input type="image" name="submit_go_" src="<?php echo get_bloginfo('template_directory'); ?>/images/login-btn.jpg" value="Login" />
    </div>
    </form>
</div>
